﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using CombatAutomationTheater;

namespace XMLCharSheets
{
    /// <summary>
    /// Interaction logic for PathfinderVisualUserControl.xaml
    /// </summary>
    public partial class PathfinderVisualUserControl : UserControl
    {
        private readonly PathfinderCustomControlViewModel _pathfinderCustomControlViewModel;
        private readonly LightControlViewModel _primaryLight;

        public PathfinderVisualUserControl(PathfinderCustomControlViewModel pathfinderCustomControlViewModel, 
            LightControlViewModel primaryLight, LightControlViewModel secondaryLight)
        {
            _pathfinderCustomControlViewModel = pathfinderCustomControlViewModel;
            _primaryLight = primaryLight;


            InitializeComponent();
            
            PrimaryLightRadiusCreationControl.ViewModel = primaryLight;
            SecondaryLightRadiusCreationControl.ViewModel = secondaryLight;
            LightControlViewModel.SetToPrimary(primaryLight);
            LightControlViewModel.SetToSecondary(secondaryLight);


            DataContext = _pathfinderCustomControlViewModel;
        }

        PathfinderSystemService pathfinderSystemService
        {
            get { return ((CombatService.RosterViewModel.ChosenSystemService) as PathfinderSystemService); }
        }
        
        private void SetDefaultLightToLevel_Button_Click(object sender, RoutedEventArgs e)
        {
            pathfinderSystemService.LightData.EnvironmentLight = _primaryLight.SelectedLight;
        }




    }
}
